#!/bin/bash
BASEDIR=$(dirname "$0")
cd $BASEDIR/..

workPath="../install"

mkdir build
cd build

# wine-msvc安装参考
# https://github.com/mstorsjo/msvc-wine
# 编译卡住的时候用wineserver -k 重启wine

# build type Debug, Release, RelWithDebInfo and MinSizeRel

export PATH=/home/yangwang/msvc-wine/msvc/bin/x64:$PATH
CC=cl CXX=cl cmake ../ \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_SYSTEM_NAME=Windows \
    -DCMAKE_INSTALL_PREFIX=${workPath}
num=$(cat /proc/cpuinfo  | grep process | wc -l)
make -j${num}
make install
cd -
